package com.wt.struggle.goodbye.db

import android.content.Context
import android.database.sqlite.SQLiteDatabase
import android.database.sqlite.SQLiteOpenHelper

class DbHelper(context: Context) : SQLiteOpenHelper(context, TAB_NAME, null, VERSION) {

    override fun onCreate(p0: SQLiteDatabase?) {
        p0!!.execSQL(CREATE_SQL)

    }

    override fun onUpgrade(p0: SQLiteDatabase?, p1: Int, p2: Int) {

    }


    companion object {
        val TAB_NAME = "user.db"
        val VERSION = 1

        val NAME = "data"
        val USER_NAME = "userName"
        val ACCOUNT = "account"
        val PWD = "pwd"
        val IMAGE_HEAD = "imageHead"

        val CREATE_SQL =
            "CREATE TABLE IF NOT EXISTS $NAME(id integer PRIMARY KEY, $USER_NAME text, $PWD text, $IMAGE_HEAD text, $ACCOUNT text)"

    }
}